import {resetForm} from 'plugins/utils.js'

export function loadSelect (state) {
  state.type = this._vm.$data.$$state.listHost.type
  state.re_per = this._vm.$data.$$state.listHost.re_per
  state.status = this._vm.$data.$$state.listHost.status
}

export function saveSuccess (state) {
  state.loading.hide()
  this.$router.push('/listhost')
}

export function saveFail (state, payload) {
  state.loading.hide()
  for (var name in payload) {
    state.msg[name] = payload[name][0]
  }
}

export function reset (state) {
  state.fields = {}
  resetForm(state.msg)
}
